<template>
  <div>
    <van-nav-bar title="地图找房">
      <template #left>
        <van-icon
          name="arrow-left"
          size="18"
          color="white"
          @click="$router.go(-1)"
        />
      </template>
    </van-nav-bar>
    <MapContainer :body="body" v-if="flag" />
  </div>
</template>

<script>
import { getAreaHouse } from '@/api/house'
import MapContainer from '@/components/MapContainer/MapContainer.vue'
export default {
  name: 'Map',
  components:{
    MapContainer
  },
  data(){
    return{
      flag:false,
      body:[]
    }
  },
  props: {},
 async  created(){
    const id = localStorage.getItem('id')
    const {
      data: { body }
    } = await getAreaHouse({ id })
       console.log(body);
       this.body=body
       this.flag=true
   }

}
</script>

<style scoped lang="less">
.van-nav-bar {
  background-color: #23d881 !important;
}
.van-nav-bar .van-icon {
  color: white !important;
}
</style>
